Average Maximum & Minimum Temperatures (C) in January
ny_noaa_data %>%
select(id, year, month, tmax, tmin) %>%
group_by(year) %>%
drop_na(tmax, tmin) %>%
filter(month == 1) %>%
mutate(month = recode(month,
'1' = 'January'),
mean_tmax = mean(tmax),
mean_tmin = mean(tmin)) %>%
select(-tmin, -tmax) %>%
pivot_longer(
mean_tmax:mean_tmin,
names_to = "temp_observation",
values_to = "temp_measurement") %>%
plot_ly(
x = ~year, y = ~temp_measurement, group = ~temp_observation, color = ~temp_observation, mode = 'lines+markers')
## Warning in plot_ly(., x = ~year, y = ~temp_measurement, group = ~temp_observation, : The group argument has been deprecated. Use `group_by()` or split instead.
## See `help('plotly_data')` for examples
## No trace type specified:
## Based on info supplied, a 'scatter' trace seems appropriate.
## Read more about this trace type -> https://plotly.com/r/reference/#scatter
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels